package com.baselibrary.test.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.baselibrary.libs.Utils.log.LogUtils;
import com.baselibrary.libs.View.bar.initAction_Bar;
import com.baselibrary.libs.base.baseActivity.BaseActivity;
import com.baselibrary.test.MVP.Main10Activity.contract.Main10Contract;
import com.baselibrary.test.MVP.Main12Activity.presenter.Main12Presenter;
import com.baselibrary.test.R;
import com.baselibrary.test.app.AppContext;

public class Main12Activity extends BaseActivity implements View.OnClickListener, Main10Contract.View {

    public final int num = 0xff;

    private Button bt;
    private initAction_Bar action_bar;
    private Main12Presenter mPresenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public int getlayouXML() {
        return R.layout.activity_main12;
    }

    @Override
    public void initP() {
        mPresenter = new Main12Presenter(this);
    }

    @Override
    public void initView() {

        bt = (Button) findViewById(R.id.bt);
        bt.setOnClickListener(this);
        action_bar = (initAction_Bar) findViewById(R.id.action_bar);
    }

    @Override
    public void initData() {

    }

    @Override
    public void initListener() {

    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.bt:
                startActivityForResult(new Intent(AppContext.getApplication(),Down_Up_Activity.class),num);
                break;
        }
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (null == data){
            return;
        }
        Bundle extras = data.getExtras();
        switch (resultCode){
            case 100:
                LogUtils.i("付出 有结果"+"结果是"+extras.getString("2"));
            break;
        }
    }
}
